\section{Model Refinement and Simplification}\label{sec:improvementandsimplification}
Though the basic model is accurate in the aggregate across all benchmarks, some benchmarks have room for improvement.
Inspecting these cases leads us to a refinement of the basic model to allow piecewise variations with respect to frequency (\refsec{sec:piecewise-refinement}).
Then, upon inspecting the actual fitted coefficients, we find that in fact the model may be further simplified to consider just the \emph{maximum} frequency, \MaxFreq (see \refsec{sec:simplify}).

\subsection{Improved Piecewise Power Model}\label{sec:piecewise-refinement}
We used the 28 benchmarks from SPEC2006 to form workloads on which to build our power model on five different multicore processors.
Table~\ref{tab:boxresidual} shows the relative errors of different benchmarks on the quad-core Sandy Bridge platform.
The basic power model in \refeq{eq:basic} does not provide an accurate prediction for some benchmarks, including \textcode{458.sjeng}.
As \reffig{fig:PW_piecewise} shows, plotting power as a function of \AvgFreq and \DisparityMaxAvg reveals that the power surface consists of multiple piecewise planes.
The distance between the parallel contour lines is also uneven, which again confirms the piecewise planar nature of the power surface.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newsavebox{\boxresidual}
\Large
\begin{lrbox}{\boxresidual}
\begin{tabular}{|l|c|c|c|c|c|c|c|c|c|}
\hline
Benchmark &Model & Res $\le$ 5\%& Res $\le$ 3\% & Max \% &  Avg \%& Max Res & Min Res & Avg AbsRes \\
\hline
\multirow{3}{*}{401.bzip2}  & Basic     &  0.985 & 0.985 & 0.055 &  0.007 & 0.880 & -0.347 & 0.160\\
                        &Piecewise      &  1.000 & 1.000 & 0.013 &  0.003 & 0.346 & -0.219 & 0.094\\
                        &Simplified     &  1.000 & 1.000 & 0.012 &  0.004 & 0.341 & -0.223 & 0.098\\
\hline
\multirow{3}{*}{403.gcc}&Basic          &  0.985 & 0.971 & 0.158 &  0.006 & 0.586 & -1.999 & 0.111\\
                     &Piecewise         &  1.000 & 1.000 & 0.010 &  0.001 & 0.111 & -0.226 & 0.035\\
                    &Simplified         &  1.000 & 1.000 & 0.008 &  0.002 & 0.133 & -0.200 & 0.047\\
\hline
\multirow{3}{*}{410.bwaves}&Basic       &  0.985 & 0.985 & 0.084 &  0.010 & 1.620 & -0.517 & 0.308\\
                   &Piecewise           &  1.000 & 1.000 & 0.010 &  0.002 & 0.269 & -0.234 & 0.078\\
                    &Simplified         &  1.000 & 1.000 & 0.010 &  0.003 & 0.278 & -0.294 & 0.109\\
\hline
\multirow{3}{*}{416.gamess}&Basic       &  0.800 & 0.685 & 0.175 &  0.029 & 2.819 & -2.015 & 0.716\\
                        &Piecewise      &  0.900 & 0.842 & 0.081 &  0.018 & 2.056 & -1.580 & 0.460\\
                        &Simplified     &  0.900 & 0.857 & 0.081 &  0.018 & 2.083 & -1.584 & 0.461\\
\hline
\multirow{3}{*}{429.mcf}&Basic          &  0.928 & 0.800 & 0.152 &  0.020 & 1.160 & -2.048 & 0.379\\
                        &Piecewise      &  1.000 & 1.000 & 0.017 &  0.003 & 0.346 & -0.183 & 0.082\\
                        &Simplified     &  0.928 & 0.914 & 0.070 &  0.007 & 1.047 & -1.411 & 0.150\\
\hline
\multirow{3}{*}{433.milc}&Basic         &  0.985 & 0.985 & 0.095 &  0.012 & 1.661 & -0.593 & 0.326\\
                    &Piecewise          &  1.000 & 1.000 & 0.011 &  0.003 & 0.244 & -0.379 & 0.090\\
                    &Simplified         &  1.000 & 1.000 & 0.013 &  0.003 & 0.296 & -0.418 & 0.098\\
\hline
\multirow{3}{*}{434.zeusmp}&Basic       &  0.985 & 0.985 & 0.084 &  0.010 & 1.488 & -0.459 & 0.278\\
                        &Piecewise      &  1.000 & 1.000 & 0.009 &  0.001 & 0.229 & -0.224 & 0.052\\
                        &Simplified     &  1.000 & 1.000 & 0.010 &  0.002 & 0.236 & -0.256 & 0.071\\
\hline
\multirow{3}{*}{435.gromacs}&Basic      &  0.985 & 0.971 & 0.159 &  0.006 & 0.555 & -1.950 & 0.110\\
                        &Piecewise      &  1.000 & 1.000 & 0.010 &  0.001 & 0.156 & -0.221 & 0.035\\
                        &Simplified     &  1.000 & 1.000 & 0.012 &  0.002 & 0.232 & -0.271 & 0.045\\
\hline
\multirow{3}{*}{436.cactusADM} &Basic   &  0.985 & 0.971 & 0.171 &  0.006 & 0.574 & -2.122 & 0.123\\
                        &Piecewise      &  1.000 & 1.000 & 0.006 &  0.002 & 0.160 & -0.137 & 0.048\\
                        &Simplified     &  1.000 & 1.000 & 0.007 &  0.002 & 0.153 & -0.157 & 0.050\\
\hline
\multirow{3}{*}{437.leslie3d} &Basic    &  0.985 & 0.985 & 0.102 &  0.012 & 1.884 & -0.589 & 0.354\\
                        &Piecewise      &  1.000 & 1.000 & 0.012 &  0.002 & 0.253 & -0.312 & 0.069\\
                        &Simplified     &  1.000 & 1.000 & 0.015 &  0.002 & 0.269 & -0.392 & 0.079\\
\hline
\multirow{3}{*}{444.namd} &Basic        &  0.985 & 0.985 & 0.068 &  0.008 & 1.214 & -0.359 & 0.217\\
                        &Piecewise      &  1.000 & 1.000 & 0.008 &  0.001 & 0.213 & -0.161 & 0.045\\
                        &Simplified     &  1.000 & 1.000 & 0.008 &  0.001 & 0.215 & -0.149 & 0.047\\
\hline
\multirow{3}{*}{445.gobmk}&Basic        &  0.985 & 0.985 & 0.086 &  0.010 & 1.690 & -0.557 & 0.321\\
                    &Piecewise          &  1.000 & 1.000 & 0.009 &  0.001 & 0.274 & -0.234 & 0.062\\
                    &Simplified         &  1.000 & 1.000 & 0.010 &  0.002 & 0.284 & -0.281 & 0.079\\
\hline
\multirow{3}{*}{447.dealII}&Basic       &  1.000 & 0.928 & 0.044 &  0.010 & 1.269 & -0.721 & 0.415\\
                    &Piecewise          &  1.000 & 1.000 & 0.014 &  0.001 & 0.501 & -0.395 & 0.074\\
                    &Simplified         &  1.000 & 1.000 & 0.014 &  0.002 & 0.501 & -0.395 & 0.083\\
\hline
\multirow{3}{*}{450.soplex}&Basic       &  0.985 & 0.985 & 0.082 &  0.007 & 1.563 & -0.299 & 0.189\\
                    &Piecewise          &  1.000 & 1.000 & 0.007 &  0.001 & 0.192 & -0.152 & 0.051\\
                    &Simplified         &  1.000 & 1.000 & 0.008 &  0.002 & 0.181 & -0.216 & 0.059\\
\hline
\multirow{3}{*}{453.povray}&Basic       &  0.985 & 0.985 & 0.120 &  0.005 & 0.582 & -1.697 & 0.113\\
                    &Piecewise          &  1.000 & 1.000 & 0.005 &  0.001 & 0.112 & -0.122 & 0.038\\
                    &Simplified         &  1.000 & 1.000 & 0.005 &  0.001 & 0.114 & -0.129 & 0.039\\
\hline
\multirow{3}{*}{454.calculix}&Basic     &  0.985 & 0.985 & 0.050 &  0.006 & 0.927 & -0.330 & 0.190\\
                    &Piecewise          &  1.000 & 1.000 & 0.009 &  0.002 & 0.314 & -0.186 & 0.066\\
                    &Simplified         &  1.000 & 1.000 & 0.009 &  0.003 & 0.269 & -0.258 & 0.092\\
\hline
\multirow{3}{*}{456.hmmer} &Basic       &  0.857 & 0.800 & 0.161 &  0.024 & 1.269 & -2.195 & 0.458\\
                    &Piecewise          &  0.914 & 0.914 & 0.071 &  0.007 & 1.368 & -1.435 & 0.165\\
                    &Simplified         &  0.914 & 0.914 & 0.073 &  0.008 & 1.347 & -1.466 & 0.174\\
\hline
\multirow{3}{*}{458.sjeng}&Basic        &  0.642 & 0.142 & 0.504 &  0.094 & 6.841 & -3.331 & 1.896\\
                    &Piecewise          &  1.000 & 1.000 & 0.003 &  0.001 & 0.087 & -0.080 & 0.030\\
                    &Simplified         &  1.000 & 1.000 & 0.006 &  0.002 & 0.102 & -0.146 & 0.051\\
\hline
\multirow{3}{*}{459.GemsFDTD}&Basic     &  0.971 & 0.914 & 0.131 &  0.008 & 1.777 & -1.507 & 0.170\\
                    &Piecewise          &  0.985 & 0.985 & 0.064 &  0.003 & 1.730 & -0.369 & 0.085\\
                    &Simplified         &  0.985 & 0.985 & 0.072 &  0.003 & 1.940 & -0.243 & 0.088\\
\hline
\multirow{3}{*}{462.libquantum}&Basic   &  0.985 & 0.985 & 0.052 &  0.007 & 0.973 & -0.347 & 0.199\\
                    &Piecewise          &  1.000 & 1.000 & 0.029 &  0.001 & 0.754 & -0.239 & 0.054\\
                    &Simplified         &  1.000 & 0.985 & 0.030 &  0.001 & 0.759 & -0.221 & 0.057\\
\hline
\multirow{3}{*}{464.h264ref}&Basic      &  0.985 & 0.985 & 0.066 &  0.008 & 1.246 & -0.422 & 0.247\\
                    &Piecewise          &  1.000 & 1.000 & 0.010 &  0.001 & 0.235 & -0.374 & 0.061\\
                    &Simplified         &  1.000 & 1.000 & 0.011 &  0.001 & 0.235 & -0.384 & 0.060\\
\hline
\multirow{3}{*}{465.tonto}&Basic        &  0.900 & 0.771 & 0.123 &  0.023 & 1.278 & -1.977 & 0.531\\
                    &Piecewise          &  0.971 & 0.814 & 0.059 &  0.015 & 1.331 & -1.225 & 0.394\\
                    &Simplified         &  0.971 & 0.828 & 0.059 &  0.015 & 1.323 & -1.302 & 0.407\\
\hline
\multirow{3}{*}{470.lbm}&Basic          &  0.985 & 0.985 & 0.087 &  0.009 & 1.210 & -0.310 & 0.192\\
                    &Piecewise          &  1.000 & 1.000 & 0.009 &  0.001 & 0.162 & -0.173 & 0.029\\
                    &Simplified         &  1.000 & 1.000 & 0.011 &  0.001 & 0.169 & -0.216 & 0.038\\
\hline
\multirow{3}{*}{471.omnetpp}&Basic      &  0.642 & 0.385 & 0.357 &  0.065 & 5.816 & -3.424 & 1.652\\
                    &Piecewise          &  0.900 & 0.757 & 0.216 &  0.024 & 4.616 & -1.218 & 0.611\\
                    &Simplified         &  0.942 & 0.714 & 0.225 &  0.022 & 4.769 & -0.990 & 0.559\\
\hline
\multirow{3}{*}{473.astar}&Basic        &  0.985 & 0.985 & 0.050 &  0.006 & 0.869 & -0.282 & 0.163\\
                    &Piecewise          &  1.000 & 1.000 & 0.008 &  0.002 & 0.191 & -0.143 & 0.055\\
                    &Simplified         &  1.000 & 1.000 & 0.008 &  0.002 & 0.192 & -0.144 & 0.055\\
\hline
\multirow{3}{*}{481.wrf}&Basic          &  0.885 & 0.785 & 0.156 &  0.021 & 1.398 & -2.143 & 0.416\\
                    &Piecewise          &  0.928 & 0.900 & 0.071 &  0.009 & 1.206 & -1.435 & 0.214\\
                    &Simplified         &  0.914 & 0.885 & 0.073 &  0.010 & 1.224 & -1.491 & 0.226\\
\hline
\multirow{3}{*}{482.sphinx3}&Basic      &  0.985 & 0.985 & 0.056 &  0.007 & 0.786 & -0.229 & 0.141\\
                    &Piecewise          &  1.000 & 1.000 & 0.009 &  0.001 & 0.165 & -0.091 & 0.030\\
                    &Simplified         &  1.000 & 1.000 & 0.008 &  0.002 & 0.165 & -0.149 & 0.060\\
\hline
\multirow{3}{*}{483.xalancbmk}&Basic    &  0.900 & 0.628 & 0.070 &  0.025 & 1.577 & -1.995 & 0.744\\
                    &Piecewise          &  0.942 & 0.742 & 0.059 &  0.021 & 1.420 & -1.843 & 0.651\\
                    &Simplified         &  0.871 & 0.557 & 0.077 &  0.031 & 1.559 & -2.400 & 0.939\\
\hline
\end{tabular}
\end{lrbox}
\normalsize
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{table}[htbp]
\caption{Comparing the Residuals on Different Benchmarks of our Basic, Piecewise, and Simplified power models.
%  \TODO{Again, do we really need so many digits of precision? This table is too small as-is, and fewer digits may help us enlarge it.}
}
\begin{center}
\label{tab:boxresidual}
\scalebox{0.37}{\usebox{\boxresidual}}
\end{center}
\end{table}
%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%
\begin{figure}[htbp]
    \subfigure[The measured power surface is a piecewise planar in \AvgFreq and \DisparityMaxAvg.]
    {
        \label{fig:PW_surface}
        \includegraphics[width=0.25\textwidth]{IPDPS_458_sjeng_P0_DiffMaxAvg_Surf_PP0}
    }
    \subfigure[The contour lines of measured power surface in \reffig{fig:PW_surface} are parallel lines, but the distances is not equal.]
    {
        \label{fig:PW_contour}
        \includegraphics[width=0.18\textwidth]{IPDPS_458_sjeng_P0_DiffMaxAvg_Contour_PP0}
    }
    \caption{The measured power surface varies linearly with \AvgFreq and \DisparityMaxAvg, but with varying slopes.}
    \label{fig:PW_piecewise}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Thus, we can consider extending our basic model to be piecewise linear.
More formally, let $[\MinFreqSetting, \MaxFreqSetting]$ be the interval of all possible frequencies.
Consider a $k$-way partition of this interval into $k$ segments such that
%
\begin{equation}\label{eq:frequencies-partition}
  \MinFreqSetting \equiv \phi_0 < \phi_1 < \phi_2 < \cdots < \phi_{k-1} < \phi_{k} \equiv \MaxFreqSetting.
\end{equation}
%
Then, a piecewise linear power model might take the form,
%
\begin{equation}\label{eq:piecewisemultiplelinearmodel}
  \PowerMC(\AvgFreq, \DisparityMaxAvg)
    = \left\{\begin{array}{l}
        a_{i,0} + a_{i,1} \cdot \AvgFreq + a_{i,3} \times \DisparityMaxAvg \\
%       & f_{p_i} \le f_{avg}+\Delta^{max}_{avg} \le f_{p_{i+1}}
\mbox{\quad when } \phi_{i-1} \leq \AvgFreq + \DisparityMaxAvg \leq \phi_{i} \\
    \end{array}\right.,
\end{equation}
%
where the $a_{i, 0}$, $a_{i,1}$, and $a_{i,3}$ are the coefficients of frequency segment $i \in \{1, \ldots, k\}$.
We have observed that typically $k \leq 3$ captures the piecewise planar behavior for all of the SPEC benchmarks.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

The piecewise power model reduces the maximum relative residual to $1.6\%$ from the original $50\%$ by the basic model and improves the prediction accuracy by $31$ times. The piecewise power model also reduces the average relative residual to $0.039$ from $1.89$. Prediction accuracy improves by about $40$ times on average. \RefTable{tab:boxresidual} presents the detailed comparison between the basic model and piecewise model. Overall, the latter provides higher prediction accuracy, and particularly for applications which have piecewise power surfaces and their slopes of each piece are very different (such as \textcode{458.sjeng}).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Simplified Piecewise Linear Power Model}\label{sec:simplify}
\RefTable{tab:basicmodelparameter} gives the values of the actual fitted coefficients of the basic power model for different workloads on our platforms. In this table, $a_1$ is the coefficient for the collective variable \AvgFreq; $a_3$ is the coefficient for the disparity variable $\DisparityMaxAvg$; $a_0$ is the constant offset, which is the extrapolated power if the frequency is zero for all cores.
\newsavebox{\boxbasicmodelparameter}
\Large
\begin{lrbox}{\boxbasicmodelparameter}
\begin{tabular}{|l|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|}
\hline
\multirow{3}{*}{Benchmark}&\multicolumn{15}{|c|}{Power Model}\\
\cline{2-16}
&\multicolumn{3}{|c|}{Core i7-975 (Nehalem)} &\multicolumn{3}{|c|}{Core i7-2600K (Sandy Bridge)}&\multicolumn{3}{|c|}{Core i7-3770K (Ivy Bridge)}&\multicolumn{3}{|c|}{Core i7-4770K (Haswell)}&\multicolumn{3}{|c|}{Xeon E5-2670 (Sandy Bridge)}\\
\cline{2-16}
&$a_1$&$a_3$&$a_0$&$a_1$&$a_3$&$a_0$&$a_1$&$a_3$&$a_0$&$a_1$&$a_3$&$a_0$&$a_1$&$a_3$&$a_0$\\
\hline
401.bzip2       & 10.215682 & 10.134396 & -1.055322 & 6.775774 & 7.603363 & 3.476741 & 2.548071 & 2.500676 & 12.490815 & 2.633567 & 2.523485 & 13.160153 & 8.505626 & 8.024321 & -3.143689\\
403.gcc         & 9.447786 & 9.286592 & -0.431359 & 6.898597 & 6.745698 & 3.601477 & 7.782073 & 7.623171 & 8.290229 & 4.451910 & 4.268524 & 6.265238 & 8.053994 & 6.937428 & -3.534713\\
410.bwaves      & 17.119395 & 16.862152 & -8.407159 & 12.206241 & 11.840186 & -1.970601 & 4.613075 & 4.408979 & 12.301156 & 5.415025 & 5.464870 & 5.544787 & 10.283753 & 8.822958 & -4.802293\\
416.gamess      & 14.461472 & 13.735060 & -10.279368 & 11.386805 & 11.198680 & -5.327534 & 7.470406 & 7.708543 & 8.929498 & 8.517569 & 4.339154 & 0.928620 & 2.848912 & 0.775984 & 1.977873\\
429.mcf         & 10.601474 & 10.336629 & -5.805702 & 8.975982 & 8.902680 & -2.438848 & 7.734641 & 7.728017 & 8.289287 & 4.505750 & 4.432882 & 5.779486 & 7.483594 & 6.665821 & -1.759413\\
433.milc        & 11.950916 & 11.766811 & -3.483871 & 10.445757 & 10.246497 & -0.929231 & 7.623612 & 7.691638 & 8.481747 & 5.796889 & 6.031187 & 5.274281 & 9.197497 & 8.919024 & -3.186455\\
434.zeusmp      & 13.485751 & 13.211261 & -4.796539 & 10.377402 & 10.149563 & -0.518088 & 7.753160 & 7.672087 & 8.257792 & 5.946763 & 5.898920 & 5.341582 & 9.569033 & 9.208278 & -3.690348\\
435.gromacs     & 9.118701 & 9.093668 & -0.312516 & 6.201509 & 6.362585 & 4.240278 & 7.640935 & 7.747044 & 8.400344 & 8.175996 & 8.104413 & -2.208624 & 9.030986 & 8.419920 & -3.799076\\
436.cactusADM   & 10.419802 & 10.354797 & -4.389381 & 6.613859 & 6.568331 & 3.917986 & 7.853978 & 7.515550 & 8.040490 & 7.092310 & 7.106772 & 1.285179 & 8.491443 & 8.172465 & -2.651723\\
437.leslie3d    & 13.821409 & 13.608673 & -5.368290 & 11.902294 & 11.719820 & -2.559087 & 4.130022 & 3.844898 & 12.416583 & 6.939555 & 6.859079 & 4.372895 & 9.970687 & 9.435027 & -3.927345\\
444.namd        & 15.049061 & 14.952976 & -6.396523 & 9.582212 & 9.577878 & 1.276878 & 3.774416 & 3.492399 & 11.663142 & 6.433791 & 6.396139 & 4.815535 & 8.996244 & 8.766039 & -3.337748\\
445.gobmk       & 17.375417 & 16.859048 & -9.406807 & 12.655318 & 12.466044 & -2.378124 & 5.161996 & 4.886715 & 11.275449 & 8.449754 & 8.434426 & 2.463916 & 7.599720 & 7.064801 & -2.007940\\
447.dealII      & 25.254185 & 25.097482 & -20.988769 & 19.662403 & 19.787692 & -12.103866 & 7.497901 & 7.728550 & 9.170973 & 14.008687 & 14.080257 & -4.415710 & 8.602285 & 6.729049 & -3.267987\\
450.soplex      & 12.853196 & 12.892577 & -3.313346 & 9.788601 & 9.622120 & 1.768275 & 3.858106 & 3.852719 & 12.426247 & 6.281955 & 6.269480 & 5.102159 & 10.358706 & 9.334124 & -4.752526\\
453.povray      & 13.130683 & 12.868462 & -6.785739 & 7.999967 & 7.981461 & 3.029395 & 3.168824 & 3.029583 & 12.423120 & 9.673428 & 9.706785 & -4.847891 & 8.327485 & 7.990024 & -3.026479\\
454.calculix    & 13.119085 & 12.875919 & -3.429525 & 9.967438 & 9.730570 & 1.540316 & 3.986045 & 3.875088 & 12.018453 & 6.314262 & 6.402765 & 5.178225 & 7.383847 & 6.087202 & -1.712932\\
456.hmmer       & 12.199106 & 12.183100 & -6.219285 & 8.193298 & 8.037410 & -0.567179 & 2.567499 & 2.457958 & 12.423526 & 4.813053 & 4.788892 & 5.087985 & 6.979445 & 6.119042 & -1.250384\\
458.sjeng       & 16.831520 & 17.063880 & -22.208524 & 12.732009 & 12.544734 & -13.652700 & 4.991883 & 4.968479 & 6.132626 & 6.529101 & 6.452367 & 1.517247 & 7.312230 & 6.418466 & -1.650837\\
459.GemsFDTD    & 7.913930 & 7.808845 & 0.118563 & 7.523851 & 7.119996 & 0.977365 & 2.174997 & 2.239539 & 12.142285 & 6.881625 & 7.001213 & -1.658230 & 9.022280 & 7.605175 & -3.178560\\
462.libquantum  & 13.159024 & 13.066704 & -3.673371 & 9.855317 & 9.790722 & 1.873840 & 3.957668 & 3.858159 & 12.139366 & 6.378036 & 6.364681 & 5.004261 & 11.379626 & 10.994207 & -5.678714\\
464.h264ref     & 16.918810 & 16.594121 & -8.816083 & 10.614326 & 10.622153 & 0.444172 & 4.276205 & 4.043267 & 12.168607 & 7.037638 & 7.151123 & 4.589877 & 8.751363 & 8.815942 & -2.882428\\
465.tonto       & 12.372743 & 11.818383 & -5.144958 & 9.300645 & 8.954253 & -0.557274 & 3.058619 & 2.991277 & 12.548739 & 5.493616 & 5.318624 & 4.819000 & 5.596342 & 3.695921 & -0.154256\\
470.lbm         & 7.429292 & 7.380343 & -1.244265 & 7.742966 & 7.644712 & 0.233960 & 2.781573 & 2.641090 & 10.246461 & 4.421906 & 4.382250 & 4.896701 & 8.552713 & 8.253573 & -2.945379\\
471.omnetpp     & 18.040313 & 17.742668 & -19.932265 & 13.731597 & 14.181473 & -11.515428 & 5.853610 & 5.628301 & 6.284875 & 7.903562 & 7.877550 & 0.981218 & 10.097017 & 8.438339 & -4.619218\\
473.astar       & 13.720144 & 13.573584 & -4.696245 & 8.441982 & 8.417337 & 2.713136 & 3.276703 & 3.124512 & 12.658185 & 6.069323 & 5.985555 & 5.280918 & 8.416308 & 8.132919 & -2.676124\\
481.wrf         & 13.687993 & 13.351972 & -12.923269 & 8.352666 & 8.073987 & -0.759496 & 3.113296 & 3.044440 & 10.049451 & 4.700043 & 4.653125 & 5.152737 & 6.575575 & 4.546483 & -1.417464\\
482.sphinx3     & 7.495649 & 7.530063 & 1.276265 & 5.800663 & 5.562998 & 3.797038 & 5.020361 & 4.993131 & 6.240984 & 6.938037 & 6.964935 & 1.195357 & 10.021804 & 7.809693 & -4.596179\\
483.xalancbmk   & 13.586808 & 11.188936 & -4.808100 & 10.779626 & 7.936607 & 0.241096 & 3.763717 & 3.539831 & 12.733757 & 5.439594 & 5.499392 & 6.560735 & 3.816921 & 3.046709 & 1.673773\\
\hline
Avg & 13.2421   & 12.9728 &  -6.5329 &  9.8039 & 9.6211&  -0.7909 &  4.9083 & 4.8156 &10.3801 & 4.6166 & 4.5631& 11.3486 &  8.2581 &  7.3296 & -2.7142\\
\hline
\end{tabular}
\end{lrbox}
\normalsize
%%%%%%%%%%%%%%%%%%%%%%%%
\begin{table*}[htbp]
\begin{center}
\caption{Multicore speed scaling power model for SPEC 2006}
\label{tab:basicmodelparameter}
\scalebox{0.42}{\usebox{\boxbasicmodelparameter}}
\end{center}
\end{table*}
%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%

Observe that the coefficients $a_1$ and $a_3$ are very close, which statistical testing verifies.
This observation reflects the behavior observed in the motivating example of \reffig{fig:motivation}, in which ramping up one core quickly increases the power.

This observation further suggests a simplification of the model.
Suppose that indeed $a_3 \approx a_1$.
Then, our basic power model becomes
%
\begin{eqnarray}
  \PowerMC(\AvgFreq, \DisparityMaxAvg)
    & = & a_0 + a_1 \cdot \AvgFreq + a_3 \cdot \DisparityMaxAvg \\
    & = & a_0 + a_1 \cdot (\AvgFreq + \DisparityMaxAvg) \\
\mbox{ or } && \\
  \PowerMC(\MaxFreq) & = & a_0 + a_1 \cdot \MaxFreq,
\end{eqnarray}
%
where $\MaxFreq = \AvgFreq + \DisparityMaxAvg$ is the maximum current frequency of any core, following the notation of \refsec{sec:model}.

We can also describe the piecewise linear variant of this simplified power model.
Then, a simplified piecewise linear power model is
%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{eqnarray}\label{eq:simplifiedmodel}
  \PowerMC(\MaxFreq)
    = \left\{\begin{array}{l}
        a_{i,0} + a_{i,1} \cdot \MaxFreq \\
%       & f_{p_i} \le f_{avg}+\Delta^{max}_{avg} \le f_{p_{i+1}}
\mbox{\quad when } \phi_{i-1} \leq \MaxFreq \leq \phi_i
    \end{array}\right. .
\end{eqnarray}

\RefFigure{fig:simplified} shows the results of benchmark \textcode{458.sjeng} on the quad-core Sandy Bridge processor.
From \reffig{fig:simplifiedline}, we can make two observations.
First, all the measured points with the same maximum frequency are clustered together.
This means that the different speed distribution with the same maximum frequency will have very close power consumption.
Secondly, the simplified model can accurately predict the power.
\RefFigure{fig:simplifiedresidual} shows the residuals between the measured and the predicted results.
The maximum relative residual is less than $0.7\%$. %It shows that the simplified model not only very simple, but also has very high accuracy.
\begin{figure}[htbp]
    \subfigure[The simplified model can predict the power very close to the measured points]
    {
        \label{fig:simplifiedline}
        \includegraphics[width=0.21\textwidth]{IPDPS_458_sjeng_P0_Max_Line}
    }
    \hspace{0.1in}
    \subfigure[The residual shows that the simplified model's error is very low]
    {
        \label{fig:simplifiedresidual}
        \includegraphics[width=0.21\textwidth]{IPDPS_458_sjeng_P0_Residual_PP0_PieceWise}
    }
    \caption{Benchmarks $458.sjeng$ 's predicted power is very close to the measured power based on the simplified model}
    \label{fig:simplified}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%

%\TODO{Here, do we use the simplified linear model or the simplified piecewise linear model?}
We use the simplified piecewise linear model to predict the power of all the benchmarks on different processors and compare it with the basic and piecewise models.
The results appear in \reftab{tab:boxresidual}.
Overall, the simplified piecewise linear model performs similarly to the piecewise model or even better for some benchmarks, and it significantly outperforms the basic model.
Specifically, the prediction with the simplified model has a maximum mean relative error of 3.1\%, compared to the piecewise model's 2.4\%.
In contrast, the prediction with the basic model is 9.4\%.

